import cmd


class CustTerminal(cmd.Cmd):
    prompt = 'CustShell> '
    intro = '自定义终端'
    file = None

    def __str__(self):
        return '<CustTerminal>: xxxx'

    def do_hello(self, args):
        print('Hello Terminal.')

    def do_exit(self, args):
        print('Bye')
        return True

    def default(self, line):
        print(line)


if __name__ == '__main__':
    terminal = CustTerminal()
    print(terminal)
    terminal.cmdloop()
